<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<body>
	<form id="dept-add-dlg-form" action="CoachServlet.do?method=update"
		method="post">
		 <input type="hidden" name="id">
		<div class="datagrid-body">
			<table class="datagrid-btable" cellspacing="0" cellpadding="0"
				border="0" style="width: 100%;">
				<tbody>
										<tr class="datagrid-row">
						<td
							style="border-style: solid; width: 15%; text-align: right; padding-right: 7px">学牌车号</td>
						<td style="border-style: solid; width: 35%; text-align: left;">
							<input type="text" name="learnCardNumber"
							class="easyui-validatebox" style="width: 266px">
						</td>
					</tr>
					<tr class="datagrid-row">
						<td
							style="border-style: solid; width: 15%; text-align: right; padding-right: 7px">车牌颜色</td>
						<td style="border-style: solid; width: 35%; text-align: left;">
					        <select name="carColoc" style="width: 266px">
					        	<option value="黄色" selected="selected">黄色</option>
					        	<option value="绿色">绿色</option>
					        </select>
						</td>
					</tr>
					<tr class="datagrid-row">
						<td
							style="border-style: solid; width: 15%; text-align: right; padding-right: 7px">发动机号</td>
						<td style="border-style: solid; width: 35%; text-align: left;">
							<input type="text" name="engineNumber"
							class="easyui-validatebox" style="width: 266px">
						</td>
					</tr>
					<tr class="datagrid-row">
						<td
							style="border-style: solid; width: 15%; text-align: right; padding-right: 7px">汽车品牌</td>
						<td style="border-style: solid; width: 35%; text-align: left;">
							<input type="text" name="automobileBrand"
							class="easyui-validatebox" style="width: 266px">
						</td>
					</tr>
					<tr class="datagrid-row">
						<td
							style="border-style: solid; width: 15%; text-align: right; padding-right: 7px">汽车型号</td>
						<td style="border-style: solid; width: 35%; text-align: left;">
							<input type="text" name="carType"
							class="easyui-validatebox" style="width: 266px">
						</td>
					</tr>
					<tr class="datagrid-row">
						<td
							style="border-style: solid; width: 15%; text-align: right; padding-right: 7px">车身颜色</td>
						<td style="border-style: solid; width: 35%; text-align: left;">
							<select name="bodyColorCar" style="width: 266px">
					        	<option value="白色" selected="selected">白色</option>
					        	<option value="棕色">棕色</option>
					        	<option value="黑色">黑色</option>
					        	<option value="灰色">灰色</option>
					        	<option value="银色">银色</option>
					        	<option value="红色">红色</option>
					        </select>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
	</form>
	<script type="text/javascript">
function getQueryParam(name) {
     var obj = $('#common-dialog').dialog('options');
     var queryParams = obj["queryParams"];
     return queryParams[name];
}
//自动填充值
function autoInput(obj){
 	$.each(obj, function(i, n){
	  //from 下的input
	  $("#dept-add-dlg-form input[name='"+i+"']").val(n);
	  if(i=="carColoc"){
		  //男  女
		  $("#student-edit-form select[name='"+i+"']").val(n);
	  }
	  if(i=="bodyColorCar"){
		  //男  女
		  $("#student-edit-form select[name='"+i+"']").val(n);
	  }
	});
}
$(function(){
	var _id  =getQueryParam("id");
	$.getJSON("CoachServlet.do?method=edit",{id:_id},function(json){
			//自动添值
		  autoInput(json);
	});
});
</script>
</body>
</html>